VERSION 5.00 Begin VB.Form frmSMFTicTacToe BackColor = &H00000000& BorderStyle = 1 'Fixed Single Caption = " SMF Tic-Tac-Toe" ClientHeight = 4455 ClientLeft = 2730 ClientTop = 2040 ClientWidth = 6675 Icon = "FrmSMFTicTacToe.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False MousePointer = 15 'Size All ScaleHeight = 4455 ScaleWidth = 6675 Begin VB.TextBox box9 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 735 Left = 3120 Locked = -1 'True TabIndex = 15 Top = 2760 Width = 495 End Begin VB.TextBox box8 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 735 Left = 1920 Locked = -1 'True TabIndex = 14 Top = 2760 Width = 495 End Begin VB.TextBox box7 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 735 Left = 600 Locked = -1 'True TabIndex = 13 Top = 2760 Width = 495 End Begin VB.TextBox box6 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 735 Left = 3120 Locked = -1 'True TabIndex = 12 Top = 1560 Width = 495 End Begin VB.TextBox box5 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 735 Left = 1920 Locked = -1 'True TabIndex = 11 Top = 1560 Width = 495 End Begin VB.TextBox box4 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 735 Left = 600 Locked = -1 'True TabIndex = 10 Top = 1560 Width = 495 End Begin VB.TextBox box3 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 735 Left = 3120 Locked = -1 'True TabIndex = 9 Top = 360 Width = 495 End Begin VB.TextBox box2 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 735 Left = 1920 Locked = -1 'True TabIndex = 8 Top = 360 Width = 495 End Begin VB.TextBox Box1 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 735 Left = 600 Locked = -1 'True TabIndex = 7 Top = 360 Width = 495 End Begin VB.CommandButton Command1 Caption = "EXIT" Height = 375 Left = 2640 TabIndex = 2 Top = 3720 Width = 855 End Begin VB.CommandButton cmdPlayAgain Caption = "Play Again" Height = 375 Left = 720 TabIndex = 0 Top = 3720 Width = 1575 End Begin VB.Timer Timer1 Interval = 1 Left = 0 Top = 3120 End Begin VB.Label lblPlayer2points BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 615 Left = 4920 TabIndex = 6 Top = 2880 Width = 735 End Begin VB.Label lblPlayer1points BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 615 Left = 4920 TabIndex = 5 Top = 1440 Width = 735 End Begin VB.Label Label3 BackColor = &H00000000& Caption = "Player 2" BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 615 Left = 4440 TabIndex = 4 Top = 2160 Width = 1815 End Begin VB.Label Label2 BackColor = &H00000000& Caption = "Player 1" BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 495 Left = 4440 TabIndex = 3 Top = 720 Width = 1815 End Begin VB.Label Label1 BackColor = &H00000000& Caption = "TIE" BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 495 Left = 1800 TabIndex = 1 Top = 1680 Visible = 0 'False Width = 855 End Begin VB.Line Line4 BorderColor = &H000000FF& BorderWidth = 5 X1 = 240 X2 = 3960 Y1 = 2520 Y2 = 2520 End Begin VB.Line Line3 BorderColor = &H000000FF& BorderWidth = 5 X1 = 240 X2 = 3960 Y1 = 1320 Y2 = 1320 End Begin VB.Line Line2 BorderColor = &H000000FF& BorderWidth = 5 X1 = 2760 X2 = 2760 Y1 = 360 Y2 = 3480 End Begin VB.Line Line1 BorderColor = &H000000FF& BorderWidth = 5 X1 = 1560 X2 = 1560 Y1 = 360 Y2 = 3480 End Attribute VB_Name = "frmSMFTicTacToe" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim player1points As Integer Dim player2points As Integer Private Sub Box1_click() If Box1.Text = "" And MousePointer = 15 Then Box1.Text = "X" MousePointer = 12 End If If Box1.Text = "" And MousePointer = 12 Then Box1.Text = "O" MousePointer = 15 End If End Sub Private Sub Box2_Click() If box2.Text = "" And MousePointer = 15 Then box2.Text = "X" MousePointer = 12 End If If box2.Text = "" And MousePointer = 12 Then box2.Text = "O" MousePointer = 15 End If End Sub Private Sub Box3_Click() If box3.Text = "" And MousePointer = 15 Then box3.Text = "X" MousePointer = 12 End If If box3.Text = "" And MousePointer = 12 Then box3.Text = "O" MousePointer = 15 End If End Sub Private Sub box4_Click() If box4.Text = "" And MousePointer = 15 Then box4.Text = "X" MousePointer = 12 End If If box4.Text = "" And MousePointer = 12 Then box4.Text = "O" MousePointer = 15 End If End Sub Private Sub Box5_Click() If box5.Text = "" And MousePointer = 15 Then box5.Text = "X" MousePointer = 12 End If If box5.Text = "" And MousePointer = 12 Then box5.Text = "O" MousePointer = 15 End If End Sub Private Sub box6_Click() If box6.Text = "" And MousePointer = 15 Then box6.Text = "X" MousePointer = 12 End If If box6.Text = "" And MousePointer = 12 Then box6.Text = "O" MousePointer = 15 End If End Sub Private Sub Box7_Click() If box7.Text = "" And MousePointer = 15 Then box7.Text = "X" MousePointer = 12 End If If box7.Text = "" And MousePointer = 12 Then box7.Text = "O" MousePointer = 15 End If End Sub Private Sub Box8_Click() If box8.Text = "" And MousePointer = 15 Then box8.Text = "X" MousePointer = 12 End If If box8.Text = "" And MousePointer = 12 Then box8.Text = "O" MousePointer = 15 End If End Sub Private Sub Box9_Click() If box9.Text = "" And MousePointer = 15 Then box9.Text = "X" MousePointer = 12 End If If box9.Text = "" And MousePointer = 12 Then box9.Text = "O" MousePointer = 15 End If End Sub Private Sub Command1_Click() End Sub Private Sub cmdPlayAgain_Click() Timer1.Interval = 1 Box1.Visible = True box2.Visible = True box3.Visible = True box4.Visible = True box5.Visible = True box6.Visible = True box7.Visible = True box8.Visible = True box9.Visible = True Line1.Visible = True Line2.Visible = True Line3.Visible = True Line4.Visible = True Label1.Visible = False Box1.Text = "" box2.Text = "" box3.Text = "" box4.Text = "" box5.Text = "" box6.Text = "" box7.Text = "" box8.Text = "" box9.Text = "" End Sub Private Sub Timer1_Timer() '***************************** X's *********************************** If Box1.Text = "X" And box2.Text = "X" And box3.Text = "X" Then box4.Visible = False: box5.Visible = False: box6.Visible = False: box7.Visible = False: box8.Visible = False: box9.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box4.Text = "X" And box5.Text = "X" And box6.Text = "X" Then Box1.Visible = False: box2.Visible = False: box3.Visible = False: box7.Visible = False: box8.Visible = False: box9.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box7.Text = "X" And box8.Text = "X" And box9.Text = "X" Then Box1.Visible = False: box2.Visible = False: box3.Visible = False: box4.Visible = False: box5.Visible = False: box6.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If Box1.Text = "X" And box5.Text = "X" And box9.Text = "X" Then box2.Visible = False: box3.Visible = False: box4.Visible = False: box6.Visible = False: box7.Visible = False: box8.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box3.Text = "X" And box5.Text = "X" And box7.Text = "X" Then Box1.Visible = False: box4.Visible = False: box8.Visible = False: box9.Visible = False: box2.Visible = False: box6.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If Box1.Text = "X" And box4.Text = "X" And box7.Text = "X" Then box2.Visible = False: box3.Visible = False: box5.Visible = False: box6.Visible = False: box8.Visible = False: box9.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box2.Text = "X" And box5.Text = "X" And box8.Text = "X" Then Box1.Visible = False: box3.Visible = False: box4.Visible = False: box6.Visible = False: box7.Visible = False: box9.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If box3.Text = "X" And box6.Text = "X" And box9.Text = "X" Then Box1.Visible = False: box4.Visible = False: box7.Visible = False: box2.Visible = False: box5.Visible = False: box8.Visible = False: player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If If Box1.Text = "X" And box3.Text = "X" And box7.Text = "X" And box9.Text = "X" Then box2.Visible = False: box4.Visible = False: box5.Visible = False: box6.Visible = False: box8.Visible = False player1points = player1points + 1 lblPlayer1points.Caption = player1points Timer1.Interval = 0 Exit Sub End If '***************************** O's *********************************** If Box1.Text = "O" And box2.Text = "O" And box3.Text = "O" Then box4.Visible = False: box5.Visible = False: box6.Visible = False: box7.Visible = False: box8.Visible = False: box9.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box4.Text = "O" And box5.Text = "O" And box6.Text = "O" Then Box1.Visible = False: box2.Visible = False: box3.Visible = False: box7.Visible = False: box8.Visible = False: box9.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box7.Text = "O" And box8.Text = "O" And box9.Text = "O" Then Box1.Visible = False: box2.Visible = False: box3.Visible = False: box4.Visible = False: box5.Visible = False: box6.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If Box1.Text = "O" And box5.Text = "O" And box9.Text = "O" Then box2.Visible = False: box3.Visible = False: box4.Visible = False: box6.Visible = False: box7.Visible = False: box8.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box3.Text = "O" And box5.Text = "O" And box7.Text = "O" Then Box1.Visible = False: box4.Visible = False: box8.Visible = False: box9.Visible = False: box2.Visible = False: box6.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If Box1.Text = "O" And box4.Text = "O" And box7.Text = "O" Then box2.Visible = False: box3.Visible = False: box5.Visible = False: box6.Visible = False: box8.Visible = False: box9.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box2.Text = "O" And box5.Text = "O" And box8.Text = "O" Then Box1.Visible = False: box3.Visible = False: box4.Visible = False: box6.Visible = False: box7.Visible = False: box9.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If box3.Text = "O" And box6.Text = "O" And box9.Text = "O" Then Box1.Visible = False: box4.Visible = False: box7.Visible = False: box2.Visible = False: box5.Visible = False: box8.Visible = False: player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If Box1.Text = "O" And box3.Text = "O" And box7.Text = "O" And box9.Text = "O" Then box2.Visible = False: box4.Visible = False: box5.Visible = False: box6.Visible = False: box8.Visible = False player2points = player2points + 1 lblPlayer2points.Caption = player2points Timer1.Interval = 0 Exit Sub End If If Box1.Text <> "" And box2.Text <> "" And box3.Text <> "" And box4.Text <> "" And box5.Text <> "" And box6.Text <> "" And box7.Text <> "" And box8.Text <> "" And box9.Text <> "" Then Box1.Visible = False box2.Visible = False box3.Visible = False box4.Visible = False box5.Visible = False box6.Visible = False box7.Visible = False box8.Visible = False box9.Visible = False Line1.Visible = False Line2.Visible = False Line3.Visible = False Line4.Visible = False Label1.Visible = True End If End Sub